package com.cman777.cvideo.client;

import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;

/**
 * @author chenzhicong
 * @time 2020/12/3 11:33
 */
public class Main extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception{
        Parent root = FXMLLoader.load(Main.class.getClassLoader().getResource("index.fxml"));


        // set icon
        primaryStage.getIcons().add(new Image(Main.class.getClassLoader().getResourceAsStream("imgs/icon.png")));

        primaryStage.setTitle("视频链接解析器");
        primaryStage.setScene(new Scene(root));
        primaryStage.show();

        primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
            @Override
            public void handle(WindowEvent event) {
                System.exit(0);
            }
        });
        primaryStage.setResizable(false);



    }


    public static void main(String[] args) {
        launch(args);
    }
}
